/**
 * Created by zhangwenlei on 2017/5/1.
 */
ADF.domControl.Number = function(parent) {
    ADF.domControl.Number.superclass.constructor.call(this, parent);
};

COM.util.defineClass(ADF.domControl.Number, ADF.domControl.BaseControl, {
    getLabel: function () {
        return "Number";
    },
    setADFPrecision: function (precision) {
        if (precision) {
            $(this.domElement).attr("ADFPrecision", precision);
        } else {
            $(this.domElement).removeAttr("ADFPrecision");
        }
    },
    setADFIcon: function (icon) {
        if (icon) {
            $(this.domElement.lastChild).addClass("input-group-addon").text(icon);
        } else {
            $('.input-group-addon').text("").removeClass("input-group-addon");
        }
    },
    setQuartile: function(quartile){
        if(quartile == "true"){
            $(this.domElement).attr("quartile",quartile);
        }else if(quartile == "false"){
            $(this.domElement).removeAttr("quartile");
        }
    },
    _getDomElement: function (model) {
        var number = COM.util.HTMLUtil.createELement('<div class="input-group"><input class="form-control" style="height: 100%"/><span></span></div>');
        number.find('input').css('padding','0');
        return number[0];
    }
});